package com.itheima.log;

import java.util.concurrent.*;

public class AsyncManager {
    private static final AsyncManager me = new AsyncManager();

    private AsyncManager() {
    }

    public static AsyncManager me() {
        return me;
    }

    ExecutorService pool = new ThreadPoolExecutor(
            3,
            5,
            5,
            TimeUnit.SECONDS,
            new LinkedBlockingQueue<>(3),
            Executors.defaultThreadFactory(),
            new ThreadPoolExecutor.AbortPolicy()
    );

    public void execute(Runnable runnable) {
        pool.execute(runnable);
    }
}
